# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=webrtc-audio-processing
pkgver=0.3.1
pkgrel=6
pkgdesc="AudioProcessing module from the WebRTC project"
url="https://freedesktop.org/software/pulseaudio/webrtc-audio-processing/"
# unsupported in the code
arch="all !s390x !ppc64le !riscv64"
license="custom"
makedepends="
	autoconf
	automake
	libtool
	linux-headers
	"
subpackages="$pkgname-dev"
source="
	https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/archive/v$pkgver/webrtc-audio-processing-v$pkgver.tar.gz
	0001-remove-backtrace_symbols.patch
	add-loongarch-support.patch
	"
options="!check" # No tests
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--disable-static \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
50ee71900f49d32aecf3dd8c541fd4fe8097496fabbe5fe001691931987373c67fafdfce6648f3b2b971a1eb1883e1c9fdf015fe4cc91260bd40d753c7e538b4  webrtc-audio-processing-v0.3.1.tar.gz
cc44c6a95920ab2307337f1c8a82e278eebd08f482202014ede25d1cec89529a2872f4fbf5f7a50e4a3b3c716854ab283dac93d2a2781faaf5f9c9f3493a2b11  0001-remove-backtrace_symbols.patch
0aa68d4ff7329234db5b230acba655bce90cbb0e469d455ca3314c62349bd66496f0afce3ee6a7beefaa563b0e6ca7d3ad589dbe48d244173a7d9ab86a8bd320  add-loongarch-support.patch
"
